package cn.xsshome.xspringboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.xsshome.xspringboot.entity.Person;
import cn.xsshome.xspringboot.service.PersonMapper;

@EnableTransactionManagement
@RestController
public class PersonController {
	@Autowired
	private PersonMapper personMapper;
	@RequestMapping(value="/save")
	public Integer save(){
		Person person = new Person();
		person.setName("xiaoshuai");
		person.setPassword("123456");
		personMapper.insert(person);
		return person.getId();
	}
}
